package com.playwright.util.gpt;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

/**
 * .
 *
 * @author zenghao
 * @date 2023/3/20
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class ChatCompletion implements Serializable {

    public static final String ROLE_USER = "user";
    public static final String ROLE_ASSISTANT = "assistant";
    public static final String ROLE_SYSTEM = "system";

    private String role;

    private String content;

    public static ChatCompletion ofUser(String content) {
        return new ChatCompletion(ROLE_USER, content);
    }

    public static ChatCompletion ofAssistant(String content) {
        return new ChatCompletion(ROLE_ASSISTANT, content);
    }

    public static ChatCompletion ofSystem(String content) {
        return new ChatCompletion(ROLE_SYSTEM, content);
    }
}
